package com.solo.service.impl;

import com.solo.dao.ArticleDAO;
import com.solo.dao.CategoryDAO;
import com.solo.entity.Article;
import com.solo.service.ArticleService;

import java.util.List;

public class ArticleServiceImpl implements ArticleService {

    private ArticleDAO articleDAO;

    public ArticleServiceImpl(){
        articleDAO = new ArticleDAO();
    }
    @Override
    public boolean addArticle(Article article) {
        return articleDAO.addArticle(article);
    }

    @Override
    public boolean deleteArticle(Article article) {
        return articleDAO.deleteArticle(article);
    }

    @Override
    public boolean updateArticle(Article article) {
        return articleDAO.updateArticle(article);
    }

    @Override
    public List<Article> selectAllArticle() {
        return articleDAO.selectAllArticle();
    }

    @Override
    public Article selectArticleById(Long id) {
        return articleDAO.selectArticleById(id);
    }
}
